Tegra: bpmp: mark device "not present" on boot timeout
authorVarun Wadekar <[email protected]>
Mon, 23 Apr 2018 20:25:42 +0000 (13:25 -0700)
committerVarun Wadekar <[email protected]>
Thu, 31 Jan 2019 16:50:31 +0000 (08:50 -0800)
This patch updates the state machine to "not present" if the bpmp
firmware is not found in the system during boot. The suspend
handler also checks now if the interface exists, before updating
the internal state machine.

Reported by: Kalyani Chidambaram Vaidyanathan <[email protected]>

Change-Id: If8fd7f8e412bb603944555c24826855226e7f48c
Signed-off-by: Varun Wadekar <[email protected]>
plat/nvidia/tegra/common/drivers/bpmp/bpmp.c
plat/nvidia/tegra/include/drivers/bpmp.h

index 31c7d80510418e1d87514d7ee1838e5b3dfb35a4..29dc2674c8c34ebb8ef74a7993850e5f9d9beb2b 100644 (file)
@@ -175,6 +175,11 @@ int tegra_bpmp_init(void)
 
                } else {
                        ERROR("BPMP not powered on\n");
+
+                       /* bpmp is not present in the system */
+                       bpmp_init_state = BPMP_NOT_PRESENT;
+
+                       /* communication timed out */
                        ret = -ETIMEDOUT;
                }
        }
@@ -185,8 +190,11 @@ int tegra_bpmp_init(void)
 void tegra_bpmp_suspend(void)
 {
        /* freeze the interface */
-       bpmp_init_state = BPMP_SUSPEND_ENTRY;
-       flush_dcache_range((uint64_t)&bpmp_init_state, sizeof(bpmp_init_state));
+       if (bpmp_init_state == BPMP_INIT_COMPLETE) {
+               bpmp_init_state = BPMP_SUSPEND_ENTRY;
+               flush_dcache_range((uint64_t)&bpmp_init_state,
+                                  sizeof(bpmp_init_state));
+       }
 }
 
 void tegra_bpmp_resume(void)
index 0046f6cc7617722a6ac423f144e480c67aa0dd55..dc3fb6b614d8da88c4481373ac9063bddb826372 100644 (file)
@@ -27,6 +27,7 @@
 #define SIGN_OF_LIFE           0xAAAAAAAAU
 
 /* flags to indicate bpmp driver's state */
+#define BPMP_NOT_PRESENT       0xF00DBEEFU
 #define BPMP_INIT_COMPLETE     0xBEEFF00DU
 #define BPMP_INIT_PENDING      0xDEADBEEFU
 #define BPMP_SUSPEND_ENTRY     0xF00DCAFEU